Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] API to fetch permissions & user roles #9519

Merged
merged 6 commits into from
Feb 15, 2018

Conversation

rafaelks
Copy link
Contributor

@rafaelks rafaelks commented Jan 26, 2018

@RocketChat/core

Closes #9518

Progress

  • API: permissions
  • API: user.roles
  • Tests
  • Docs

@rafaelks
Copy link
Contributor Author

Docs created: https://github.com/RocketChat/docs/pull/527.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 January 26, 2018 15:39 Inactive
@RocketChat RocketChat deleted a comment Jan 26, 2018
@RocketChat RocketChat deleted a comment Jan 26, 2018
@rodrigok rodrigok added this to the 0.62.0 milestone Jan 26, 2018
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 February 6, 2018 11:35 Inactive
@MarcosSpessatto MarcosSpessatto changed the title [WIP][NEW] API to fetch permissions & user roles [NEW] API to fetch permissions & user roles Feb 6, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 February 6, 2018 11:44 Inactive
@RocketChat RocketChat deleted a comment Feb 6, 2018
RocketChat.API.v1.addRoute('permissions', { authRequired: true }, {
get() {
let result;
Meteor.runAsUser(this.userId, () =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcosSpessatto could you change this to

const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));

Meteor.runAsUser returns the result of the passed function.

let result;
let currentUserRoles = {};

Meteor.runAsUser(this.userId, () =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@rafaelks
Copy link
Contributor Author

Is this PR still missing something @rodrigok & @MarcosSpessatto?

@rodrigok rodrigok merged commit 9b7eb38 into develop Feb 15, 2018
@rodrigok rodrigok deleted the feature/rest_api_permissions.9518 branch February 15, 2018 19:53
@rodrigok rodrigok mentioned this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants